package com.cndym.adapterForMobile.mobile;

import java.util.Map;

import org.springframework.stereotype.Component;
import com.cndym.adapterForMobile.BaseMobileAdapter;
import com.cndym.adapterForMobile.IFunction;
import com.cndym.utils.SpringUtils;
import com.cndym.utils.Utils;

/**
 * 比赛接口适配器
 * @author 朱林虎
 *
 */
@Component
public class ClientMatchesAdapter extends BaseMobileAdapter {
	
	@Override
    public Map<String, String> execute(Map<String, String> paraMap) {
		
		String func = Utils.formatStr(paraMap.get("func"), "sportMatches");
        IFunction function = null;
        
        if (func.equals("sportMatches")) { 
        	function = (IFunction) SpringUtils.getBean("sportMatchesFunc");
        } else {
        	function = (IFunction) SpringUtils.getBean(func + "SportMatchesFunc");
        }
        
        if (null == function) {
            return funcErr();
        }
        return function.function(paraMap);
    }
}
